﻿using System;
using System.Linq;
using Trentacular.SharePoint.StsAdmin.Util;

namespace Trentacular.SharePoint.StsAdmin
{
    public class MissingParameterException : Exception
    {
        public MissingParameterException(Parameter parameter)
            : base(string.Format(
                "The required parameter '{0}' has not been specified",
                parameter.Name
                )
            ) { }

        public MissingParameterException(params Parameter[] parameters)
            : base(string.Format(
                "Please specify one the these required parameters: {0}",
                StringUtils.Delimit(parameters.Select(p => p.Name), ", ")
                )
            ) { }
    }
}
